package br.com.salao.model;

import java.util.Date;
import java.util.List;

import javax.persistence.EntityManager;

import br.com.salao.bean.DateBusy;
import br.com.salao.dao.DateBusyDao;
import br.com.salao.dao.DateBusyDaoImpl;
import br.com.salao.util.JpaUtil;

public class DateBusyModel {
	
	private EntityManager em;

	public DateBusyModel(){
		em = JpaUtil.getEntityManager();	
	}
	
	public List<DateBusy> buscarDatasFechadasPorEstab(int idEstabelecimento){	
		DateBusyDao busyDao = new DateBusyDaoImpl(em);
		return busyDao.buscarDateBusyPorEstabelecimento(idEstabelecimento);
	}
	
	public DateBusy inserir(DateBusy dateBusy){
		DateBusyDao busyDao = new DateBusyDaoImpl(em);
		return busyDao.inserir(dateBusy);
	}
	
	public List<DateBusy> buscarDateBusyPorEstabelecimentoEData(int idEstabelecimento, Date dataFechada){
		DateBusyDaoImpl dao = new DateBusyDaoImpl(em);
		return dao.buscarDateBusyPorEstabelecimentoEData(idEstabelecimento, dataFechada);
	}
	
	
	
	

}
